<?php namespace App\Services;

class ImageManager
{
    public static function clipImage($imgUrl,$x,$y,$w,$h){
        $targ_w = 460;
        $targ_h = 307;

        $img_r = imagecreatefromjpeg($imgUrl);
        $dst_r = imagecreatetruecolor($targ_w,$targ_h);
        imagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);
        return true;
    }
}